﻿<?php include("function.php"); ?>
<?php

header("Content-Type: text/html;charset=utf-8");

$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "data";
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接
if ($conn->connect_error) {
	die("连接失败: " . $conn->connect_error);
}
$conn->query("SET NAMES UTF8");
if (empty($_POST) == false) {
	// echo("use");
	$sql = "call newuser('" . $_POST["username"] . "','" . $_POST["nickname"] . "','" . $_POST["password"] . "',@outid);";
	// $conn->query($sql);
	if ($conn->query($sql) === TRUE) {
		echo "新记录插入成功";
		$result = $conn->query('select @outid;');
		$new = $result->fetch_array();
		// print_r($result);
		// var_dump($new);
		// $result=getuser_data($_POST["username"]);
		// echo($result["id"]);
		if (isset($_SESSION['id'])) {
			$_SESSION["id"] = intval($new["id"]);
		}
		// header('Location: postpc.php');
	} else {
		echo "Error: " . $sql . "<br>" . $conn->error;
	}
}
?>
<!DOCTYPE html>
<html>

<head>
	<title>login</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet" />
	<link href="data/styles.css" type="text/css" rel="stylesheet" />
	<link href="files/login/styles.css" type="text/css" rel="stylesheet" />
	<script src="resources/scripts/jquery-3.2.1.min.js"></script>
	<script src="resources/scripts/axure/axQuery.js"></script>
	<script src="resources/scripts/axure/globals.js"></script>
	<script src="resources/scripts/axutils.js"></script>
	<script src="resources/scripts/axure/annotation.js"></script>
	<script src="resources/scripts/axure/axQuery.std.js"></script>
	<script src="resources/scripts/axure/doc.js"></script>
	<script src="resources/scripts/messagecenter.js"></script>
	<script src="resources/scripts/axure/events.js"></script>
	<script src="resources/scripts/axure/recording.js"></script>
	<script src="resources/scripts/axure/action.js"></script>
	<script src="resources/scripts/axure/expr.js"></script>
	<script src="resources/scripts/axure/geometry.js"></script>
	<script src="resources/scripts/axure/flyout.js"></script>
	<script src="resources/scripts/axure/model.js"></script>
	<script src="resources/scripts/axure/repeater.js"></script>
	<script src="resources/scripts/axure/sto.js"></script>
	<script src="resources/scripts/axure/utils.temp.js"></script>
	<script src="resources/scripts/axure/variables.js"></script>
	<script src="resources/scripts/axure/drag.js"></script>
	<script src="resources/scripts/axure/move.js"></script>
	<script src="resources/scripts/axure/visibility.js"></script>
	<script src="resources/scripts/axure/style.js"></script>
	<script src="resources/scripts/axure/adaptive.js"></script>
	<script src="resources/scripts/axure/tree.js"></script>
	<script src="resources/scripts/axure/init.temp.js"></script>
	<script src="resources/scripts/axure/legacy.js"></script>
	<script src="resources/scripts/axure/viewer.js"></script>
	<script src="resources/scripts/axure/math.js"></script>
	<script src="resources/scripts/axure/jquery.nicescroll.min.js"></script>
	<script src="data/document.js"></script>
	<script src="files/login/data.js"></script>
	<script type="text/javascript">
		$axure.utils.getTransparentGifPath = function() {
			return 'resources/images/transparent.gif';
		};
		$axure.utils.getOtherPath = function() {
			return 'resources/Other.html';
		};
		$axure.utils.getReloadPath = function() {
			return 'resources/reload.html';
		};
	</script>
</head>

<body>
	<form action="zhuce.php" method="post">
		<div id="base" class="">

			<!-- Unnamed (矩形) -->
			<div id="u0" class="ax_default box_1">
				<div id="u0_div" class=""></div>
				<div id="u0_text" class="text " style="display:none; visibility: hidden">
					<p></p>
				</div>
			</div>

			<!-- Unnamed (组 合) -->
			<div id="u1" class="ax_default" data-left="70" data-top="60" data-width="400" data-height="40">

				<!-- Unnamed (矩形) -->
				<div id="u2" class="ax_default label">
					<div id="u2_div" class=""></div>
					<div id="u2_text" class="text ">
						<p><span style="text-decoration:none;">用户名</span></p>
					</div>
				</div>

				<!-- TextBorder (矩形) -->
				<div id="u3" class="ax_default box_2" data-label="TextBorder">
					<div id="u3_div" class=""></div>
					<div id="u3_text" class="text " style="display:none; visibility: hidden">
						<p></p>
					</div>
				</div>

				<!-- username (文本框) -->
				<div id="u4" class="ax_default text_field" data-label="username">
					<div id="u4_div" class=""></div>
					<input id="u4_input" type="text" value="" class="u4_input" name="username" />
				</div>
			</div>

			<!-- Unnamed (组 合) -->
			<div id="u5" class="ax_default" data-left="70" data-top="120" data-width="400" data-height="40">

				<!-- Unnamed (矩形) -->
				<div id="u6" class="ax_default label">
					<div id="u6_div" class=""></div>
					<div id="u6_text" class="text ">
						<p><span style="text-decoration:none;">密&nbsp; &nbsp; 码</span></p>
					</div>
				</div>

				<!-- Unnamed (矩形) -->
				<div id="u7" class="ax_default box_3">
					<div id="u7_div" class=""></div>
					<div id="u7_text" class="text " style="display:none; visibility: hidden">
						<p></p>
					</div>
				</div>

				<!-- TextBorder (矩形) -->
				<div id="u8" class="ax_default box_2" data-label="TextBorder">
					<div id="u8_div" class=""></div>
					<div id="u8_text" class="text " style="display:none; visibility: hidden">
						<p></p>
					</div>
				</div>

				<!-- Unnamed (动态面板) -->
				<div id="u9" class="ax_default">
					<div id="u9_state0" class="panel_state" data-label="State1" style="">
						<div id="u9_state0_content" class="panel_state_content">

							<!-- HidePassword (文本框) -->
							<div id="u10" class="ax_default text_field" data-label="HidePassword">
								<div id="u10_div" class=""></div>
								<input id="u10_input" type="password" value="" class="u10_input" name="password" />
							</div>
						</div>
					</div>
					<div id="u9_state1" class="panel_state" data-label="State2" style="visibility: hidden;">
						<div id="u9_state1_content" class="panel_state_content">

							<!-- ShowPassword (文本框) -->
							<div id="u11" class="ax_default text_field" data-label="ShowPassword">
								<div id="u11_div" class=""></div>
								<input id="u11_input" type="text" value="" class="u11_input" name="showpassword" />
							</div>
						</div>
					</div>
				</div>

				<!-- Unnamed (SVG) -->
				<div id="u12" class="ax_default _图片1">
					<img id="u12_img" class="img " src="images/login/u12.svg" />
					<div id="u12_text" class="text " style="display:none; visibility: hidden">
						<p></p>
					</div>
				</div>
			</div>

			<!-- login (矩形) -->
			<div id="u13" class="ax_default box_3" data-label="login">
				<div id="u13_div" class=""></div>
				<div id="u13_text" class="text ">
					<p><input type="submit" style="text-decoration:none;" value="注册"></p>
				</div>
			</div>

			<!-- Unnamed (组 合) -->
			<div id="u14" class="ax_default" data-left="70" data-top="180" data-width="400" data-height="40">

				<!-- Unnamed (矩形) -->
				<div id="u15" class="ax_default label">
					<div id="u15_div" class=""></div>
					<div id="u15_text" class="text ">
						<p><span style="text-decoration:none;">昵&nbsp; &nbsp; 称</span></p>
					</div>
				</div>

				<!-- TextBorder (矩形) -->
				<div id="u16" class="ax_default box_2" data-label="TextBorder">
					<div id="u16_div" class=""></div>
					<div id="u16_text" class="text " style="display:none; visibility: hidden">
						<p></p>
					</div>
				</div>

				<!-- username (文本框) -->
				<div id="u17" class="ax_default text_field" data-label="username">
					<div id="u17_div" class=""></div>
					<input id="u17_input" type="text" value="" class="u17_input" name="nickname" />
				</div>
			</div>
		</div>
	</form>
	<script src="resources/scripts/axure/ios.js"></script>
</body>

</html>